<?php
namespace app\api\model;

use think\Model;

class OrderMake extends Base{
    protected $name = 'order_make';
    protected $updateTime = false;

    public function getTechnTimeIdAttr($val){
        return (new TechnTime())->getFind(['id' => $val])['data'];
    }

    public function getStatusAttr($val){
        $status = [1 => '已预约', 2 => '已完成', 3 => '已取消', 4 => '已过期'];
        return $status[$val];
    }

    public function getMakeTimeAttr($val){
        if(!$val){
            return '';
        }

        return date('Y-m-d H:i:s', $val);
    }
}